package com.adee.nowcoder.huawei;

import java.util.Scanner;

public class T031_HJ031 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            String[] arr = str.replaceAll("[^a-zA-Z]", " ").split("[\\s]+");
            int i = 0, j = arr.length-1;
            while (i < j) {
                String tmp = arr[i];
                arr[i++] = arr[j];
                arr[j--] = tmp;
            }

            for (String s : arr) {
                System.out.print(s + " ");
            }
        }
    }
    public static String reverse(String s) {
        if (s == null || s.length() == 0) return "";
        StringBuilder sb = new StringBuilder();
        for (int i = s.length()-1; i >= 0; i--) {
            sb.append(s.charAt(i));
        }
        return sb.toString();
    }
}
